package com.muyu.danmo.mapper;


import com.muyu.danmo.domain.DanmoCommunityFavorite;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 社区收藏Mapper接口
 * @author kunzong
 * @date 2024-10-30
 */
public interface DanmoCommunityFavoriteMapper {  

    List<DanmoCommunityFavorite> selectDanmoCommunityFavoriteList(DanmoCommunityFavorite danmoCommunityFavorite);

    DanmoCommunityFavorite selectDanmoCommunityFavoriteById(Long id);

    int insertDanmoCommunityFavorite(DanmoCommunityFavorite danmoCommunityFavorite);  

    int updateDanmoCommunityFavorite(DanmoCommunityFavorite danmoCommunityFavorite);  

    int deleteDanmoCommunityFavoriteByIds(Long[] ids);


    void deleteByCommunity(@Param("id") Long id);

    /**
     * 根据用户id和帖子id查询是否已收藏
     * @param danmoCommunityFavorite
     */
    int selectDanmoCommunityFavoriteByUserIdAndPostId(DanmoCommunityFavorite danmoCommunityFavorite);

    int selectDanmoCommunityFavoriteByIds(Long[] ids);

    List<DanmoCommunityFavorite> selectDanmoCollectMaterialByIdAndUserId(@Param("postId") Long postId, @Param("userid") Long userid);

    void deleteDanmoCollectMaterialById(@Param("postId") Long postId);

    List<DanmoCommunityFavorite> selectDanmoCommunityFavoriteByUserId(@Param("userId") Long userId);
}